{include file="header.tpl.php"}


<div class="titleFull">

	<div class="wrapper">

		<h1 style="line-height: 100px; margin: 0px;">Leaderboard</h1>

	</div>

</div>


<div class="titleBlueBar"></div>




<div class="content2">

	<div class="wrapper">

		<div class="h30"></div>

		<div class="boxLeft2">





			<div style="float:right;"> <a href="leaderboard.php?m=today" class="slinks" {if $m eq "today"} {/if}>Today</a> | <a href="leaderboard.php?m=month" class="slinks" {if $m eq "month"} {/if}>This Month</a></div>

			<div class="h20">&nbsp;</div>
			
			<div class="listing">
			<table cellspacing="0" class="table">
			<tr class="listing_th_row">
				<th>&nbsp;&nbsp;Rank</th>
				<th>&nbsp;&nbsp;Username</th>
				<th>&nbsp;&nbsp;Earnings</th>
			</tr>


			{if $users ne ""}

			{foreach item=user from=$users name=u}

			<tr class="listing_row" {if $smarty.foreach.u.index eq "0" && $users|@count eq "1"} style="border-bottom:0; background:none" {/if}>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;{$user.rank}</td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;{if $user.hideUser eq "1" || $user.hideEarnings eq "1"}[Hidden]{else}{$user.user}{/if}</td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;{if $user.hideEarnings ne "1"}${$user.profit}{else}[Hidden]{/if}</td>
			</tr>
			{/foreach}

			{else}
			<td colspan="3"><center>Leading users not available.</center></td>

			{/if}


			</table>
			</div>

			<form action="leaderboard.php" method="post"  id="frm">
			<div  style=" clear:both; width:450px; margin:10px auto;"><div style="float:left"><input type="checkbox" name="hu" {if $hideUser eq "1"} checked="checked" {/if} value="1" id="hu"  /></div><div style="float:left; margin-left:5px;"> Hide my username in the leaderboard.</div></div>
			<div style="  clear:both; width:450px; margin:10px auto;"><div style="float:left"><input type="checkbox" name="he" {if $hideEarnings eq "1"} checked="checked" {/if}  value="1" id="he"/></div><div style="float:left; margin-left:5px;"> Hide both my username and earnings in the leaderboard.</div></div>
			<input type="hidden" name="hideUser" id="hideUser" value="{$hideUser}" />
			<input type="hidden" name="hideEarnings" id="hideEarnings" value="{$hideEarnings}" />

			</form>

			<script type="text/javascript">
			{literal}
			$(document).ready(function(){

				$('#hu').change(function(){
				
				   if($('#hu').is(':checked'))
				   $('#hideUser').val('1');
				   else
				   $('#hideUser').val('0');

				   $('#frm').submit();
					
				});	
				
				
				$('#he').change(function(){
				
				   if($('#he').is(':checked'))
				   $('#hideEarnings').val('1');
				   else
				   $('#hideEarnings').val('0');
				   
				   
					 $('#frm').submit();
					
				});		
				
				
			});
			{/literal}
			</script>
  








	</div>



<!--Right Panel-->
{include file="sidebar.tpl.php"}
<!--End Right Panel-->


{include file="footer.tpl.php"}